package com.example.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @Project: SSM-JavaConfig
 * @Title: WebAppInitializer
 * @Description: <p>前端控制器配置,MVC配置</p>
 * @Author: zhuzhaofeng
 * @Email: zhuzhaofeng@aliyun.com
 * @dateTime: 2018-12-23 16:26
 * @Version: 1.0.0
 */
@Slf4j
public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

    @Override
    protected Class<?>[] getRootConfigClasses() {
        log.info("------root配置类初始化------");
        return new Class<?>[]{RootConfig.class};
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        log.info("------web配置类初始化------");
        return new Class<?>[]{WebConfig.class};
    }

    @Override
    protected String[] getServletMappings() {
        log.info("------映射根路径初始化------");
        return new String[]{"/"};//请求路径映射，根路径
    }
}
